package operation;

import book.BookList;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-24
 * 22:30
 */
public class findoperation implements Ioperation {
    @Override
    public void work(BookList bookList) {
        System.out.println("调用查找图书，，，");
        System.out.println("请输入要查找的图书名");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        for (int i = 0; i < bookList.getSizdUsed(); i++) {
            if(name.equals(bookList.getBooks(i).getName())){
                System.out.println(bookList.getBooks(i));
                System.out.println("查找成功");
                return ;
            }

        }
        System.out.println("没有找到对应的图书");
    }
}
